<?php
//购物车模型
namespace App\Models\Product;

use Illuminate\Database\Eloquent\Model;

class Cart extends Model
{
    protected $table = 'cart';//表名

    protected $guarded = [];//

    // 是否主动维护时间戳
    public $timestamps = false;

    public function product()
    {
        //连表查询
        // belongsTo('关联模型名','本表外键','关联表的主键')
        return $this->belongsTo('App\Models\Product\Product', 'proid', 'id');
    }
}
